<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Strict//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<title>周末看新闻--网罗一周热门资讯</title>
<link rel="stylesheet" href="__ROOT__/Public/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="__ROOT__/Public/bootstrap/css/style.css">
<script src="__ROOT__/Public/bootstrap/js/jquery2.min.js"></script>
<script src="__ROOT__/Public/bootstrap/js/bootstrap.min.js"></script>

<link rel="stylesheet" href="__ROOT__/Public/css/bootstrap-datetimepicker.min.css">

<link rel="stylesheet" href="__ROOT__/Public/editor/themes/default/default.css" />
<link rel="stylesheet" href="__ROOT__/Public/editor/plugins/code/prettify.css" />
<script charset="utf-8" src="__ROOT__/Public/editor/kindeditor.js"></script>
<script charset="utf-8" src="__ROOT__/Public/editor/lang/zh_CN.js"></script>
<script charset="utf-8" src="__ROOT__/Public/editor/plugins/code/prettify.js"></script>
<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : '__ROOT__/Public/editor/plugins/code/prettify.css',
				uploadJson : '__ROOT__/Public/editor/php/upload_json.php',
				fileManagerJson : '__ROOT__/Public/editor/php/file_manager_json.php',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
</head>
<body class="body">
  <header>
    <div class="container">
      <div class="row">
        <div class="span6">
        <a href="/newskk_v2/" title="回到首页">
        <img class="img" alt="周末看新闻" src="__ROOT__/Public/images/logo1.png">
        </a>
        </div>
      </div>
    </div>
  </header>
<!-- 导航start -->
<div class="menu">
<div class="left"></div>
<div class="center">
<a href="__ROOT__/"><button class="btn">浏览新闻</button></a>
<a href="__ROOT__/index.php/Home/Form/edit/id"><button class="btn" style="align:right;">添加新闻</button></a>
</div>
<div class="right"></div>
</div>
<script>
   $(function () {
      $('#myTab li:eq(1) a').tab('show');
   });
</script>
<!-- 导航end -->
<!-- 内容start -->
<section>
  <div class="container">
    <div class="row">
      <main class="col-md-12 main-content">
<div class="input-group col-md-5">
<!-- 添加新闻表单 -->
<form name="addform" method="POST" action="__URL__/insert" enctype="multipart/form-data"   class="addform post" >
新闻标题：<input type="text" name="title" id="title"><br>
新闻内容：<textarea name="content" rows="6" cols="96"></textarea> <br>
新闻图片：<input type="file" name="pic"/><br>
新闻发布者：<input type="text" name="eauthor" id="eauthor"><br><br>
<div style="float:left;" class="input-group date form_datetime col-md-5" data-date="2015-12-03T10:10:00Z" data-date-format="yyyy-mm-dd HH:ii:ss" data-link-field="dtp_input1">
 发布时间：                                <input class="form-control" name="etime" id="etime"size="16" type="text" value="" readonly>
                <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
				<span class="input-group-addon"><span  class="glyphicon glyphicon-calendar"></span></span>
</div>
<input type="hidden" id="dtp_input1" value="" /><br/>
<br/><br/><input type="submit" class="btn btn-success" value="添加新闻">
</form> 
<!-- 编辑新闻表单 -->
<form name="editform" method="post" action="__URL__/update" enctype="multipart/form-data"  onSubmit="return IsEditEmpty();" class="editform post" >
新闻标题：<input type="text" name="title"value="{$vo.title}"><br>
新闻内容：<textarea name="content" rows="6" cols="96">{$vo.content}</textarea> <br>
新闻图片：<input type="file" name="pic" value="{$vo.pic}"/><br>
新闻发布者：<input type="text" name="eauthor" id="eauthor"  value="{$vo.eauthor}"><br><br>
<div style="float:left;" class="input-group date form_datetime col-md-5" data-date="2015-12-03T10:10:00Z" data-date-format="yyyy-mm-dd HH:ii:ss" data-link-field="dtp_input1">
 发布时间：                                <input class="form-control" name="etime" id="etime"size="16" type="text" value="{$vo.etime}" readonly>
                <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
				<span class="input-group-addon"><span  class="glyphicon glyphicon-calendar"></span></span>
</div>
<input type="hidden" name="id" value="{$vo.id}">
<input type="hidden" id="dtp_input1" value="" /><br/>
<br/><br/><input type="submit" class="btn btn-success" value="提交修改">
</form> 
</div>

<script>
if("{$vo.id}"==""){
	$(".editform").hide();
}else{
	$(".addform").hide();
}
$('input[type=submit]').click(function(){
    if($('#title').val()==''){
        alert('新闻标题不能为空');
        return false;
    }else{
        if($('#eauthor').val()==''){
            alert('请填写新闻发布人');
            return false;
        }
    }
});
</script>
 </main>
    
    </div>
  </div>
</section>
<!-- 内容end -->

<script type="text/javascript" src="__ROOT__/Public/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="__ROOT__/Public/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
$('.form_datetime').datetimepicker({
    language:  'zh-CN',
    weekStart: 1,
    todayBtn:  1,
	autoclose: 1,
	todayHighlight: 1,
	startView: 2,
	forceParse: 0,
    showMeridian: 1
})
</script>
</body>
</html>  

